/** Implementation of DataNumber Class.
 * @file 
 * @author Jeremy Schultz
 */
#include "DataNumber.h"


using namespace std;

//-----------------------------------------------------------------------------
// Constructor
DataNumber::DataNumber() : WordData(WordData::NUMBER)	{
	value = 0;
	isArray = false;
}
//-----------------------------------------------------------------------------
// Constructor
DataNumber::DataNumber(int _value) : WordData(WordData::NUMBER)	{
	value = _value;
	isArray = false;
}

//-----------------------------------------------------------------------------
// Constructor
DataNumber::DataNumber(int _size, bool _isArray) : WordData(WordData::NUMBER)	{
	value = _size;
	isArray = _isArray;
}

//-----------------------------------------------------------------------------
// Getter - Value
int DataNumber::Value()	{
	return value;
}

//-----------------------------------------------------------------------------
// Setter - Value
void DataNumber::setValue(int _value)	{
	value = _value;
}

//-----------------------------------------------------------------------------
// Getter - Size
int DataNumber::Size()	{
	if (!isArray) {
		return 0;
	}
	
	return value;
}

//-----------------------------------------------------------------------------
// convert DataNumber to string
string DataNumber::toString()	{
	stringstream ss;

	ss << WordData::toString();
	ss << " value: " << value;
	ss << " isArray: " << isArray;

	return ss.str();
}
